package com.ssii.www.myproject.common.util;

import lombok.Data;

/**
 * 返回ajax结果
 */
@Data
public class AjaxResult {
  private boolean success = true;

  private String message;

  private int errorCode;

  public boolean isSuccess() {
    return success;
  }

  public String getMessage() {
    return message;
  }

  public void setMessage(String message) {
    this.message = message;
  }

  public int getErrorCode() {
    return errorCode;
  }

  public void setErrorCode(int errorCode) {
    this.errorCode = errorCode;
  }



  public void setSuccess(boolean success) {
    this.success = success;
  }

  /**
   * 只有错误信息
   * @param message
   */
  public AjaxResult(String message){
    this.success = false;
    this.message = message;
  }
  /**
   * 返回错误信息和错误码
   * @param message
   * @param errorCode
   */
  public AjaxResult(String message,int errorCode){
    this.success = false;
    this.message = message;
    this.errorCode = errorCode;
  }


  public AjaxResult(){
    this.message="操作成功";
  }
}
